import request from "@/utils/request";

// 查询工作计划列表
export function listWorkplan(query) {
  return request({
    url: "/cld/workplan/list",
    method: "get",
    params: query,
  });
}

// 查询工作计划明细列表
export function getWorkPlanDetailsList(query) {
  return request({
    url: "/cld/workplan/getWorkPlanDetailsList",
    method: "get",
    params: query,
  });
}

// 查询工作计划明细列表
export function getCldWorkplanDetailsList(workPlanId) {
  return request({
    url: "/cld/workplan/selectWorkPlanDetailsList/" + workPlanId,
    method: "get",
  });
}

// 查询工作计划列表 -> 按项目分组统计
export function groupProjectList(query) {
  return request({
    url: "/cld/workplan/groupByProjectList",
    method: "get",
    params: query,
  });
}

// 查询工作计划详细
export function getWorkplan(workplanId) {
  return request({
    url: "/cld/workplan/" + workplanId,
    method: "get",
  });
}

// 新增工作计划
export function addWorkplan(data) {
  return request({
    url: "/cld/workplan",
    method: "post",
    data: data,
  });
}

// 修改工作计划
export function updateWorkplan(data) {
  return request({
    url: "/cld/workplan",
    method: "put",
    data: data,
  });
}

// 审核工作计划
export function auditWorkplan(data) {
  return request({
    url: "/cld/workplan/detailsAudit",
    method: "put",
    data: data,
  });
}

// 删除工作计划
export function delWorkplan(workplanId) {
  return request({
    url: "/cld/workplan/" + workplanId,
    method: "delete",
  });
}
